package com.acwing.partition27;

import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.PriorityQueue;

/**
 * @author `RKC`
 * @date 2022/3/20 9:23
 */
public class AC2621k短路 {

    private static final int N = 55, INF = 0x3f3f3f3f;
    private static int[][] g = new int[N][N], rg = new int[N][N];
    private static int[] dist = new int[N], cnt = new int[N];
    private static boolean[] st = new boolean[N];
    private static PriorityQueue<Node> heap = new PriorityQueue<>(N);
    private static int n, m;

    private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    private static final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        String[] ss = reader.readLine().split(" ");
        n = Integer.parseInt(ss[0]);
        m = Integer.parseInt(ss[1]);
        int k = Integer.parseInt(ss[2]), a = Integer.parseInt(ss[3]), b = Integer.parseInt(ss[4]);
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= n; j++) {
                g[i][j] = rg[i][j] = i == j ? 0 : INF;
            }
        }
        for (int i = 0; i < m; i++) {
            ss = reader.readLine().split(" ");
            int u = Integer.parseInt(ss[0]), v = Integer.parseInt(ss[1]), w = Integer.parseInt(ss[2]);
            g[u][v] = rg[v][u] = w;
        }
        aStar(k, a, b);
        writer.flush();
    }

    private static void aStar(int k, int a, int b) throws IOException {
        //反向做一遍dijkstra
        int[] dist = dijkstra(b);
        heap.add(new Node(0, dist[a], a));
        while (!heap.isEmpty()) {
            Node cur = heap.poll();
            int real = cur.real, u = cur.u;
            cnt[u]++;
            if (cnt[b] == k) {
                writer.write(cur.path.get(0) + "");
                for (int i = 1; i < cur.path.size(); i++) writer.write("-" + cur.path.get(i));
                return;
            }
            for (int v = 1; v <= n; v++) {
                if (u == v || g[u][v] == INF || cur.st[v]) continue;
                heap.add(new Node(real + g[u][v], real + g[u][v] + dist[v], v, cur.st, cur.path));
            }
        }
        writer.write("No");
    }

    private static int[] dijkstra(int start) {
        Arrays.fill(dist, INF);
        dist[start] = 0;
        for (int k = 0; k < n; k++) {
            int u = -1;
            for (int i = 1; i <= n; i++) {
                if (!st[i] && (u == -1 || dist[u] > dist[i])) u = i;
            }
            st[u] = true;
            for (int i = 1; i <= n; i++) dist[i] = Math.min(dist[i], dist[u] + rg[u][i]);
        }
        return dist;
    }

    private static class Node implements Comparable<Node> {
        //真实值、真实值+估价值、当前点
        private int real, sum, u;
        private List<Integer> path = new ArrayList<>();
        private boolean[] st = new boolean[N];

        public Node(int real, int sum, int u) {
            this.real = real;
            this.sum = sum;
            this.u = u;
            path.add(u);
            st[u] = true;
        }

        public Node(int real, int sum, int u, boolean[] st, List<Integer> path) {
            this.real = real;
            this.sum = sum;
            this.u = u;
            this.path.addAll(path);
            this.path.add(u);
            System.arraycopy(st, 0, this.st, 0, N);
            this.st[u] = true;
        }

        @Override
        public int compareTo(Node o) {
            if (sum != o.sum) return sum - o.sum;
            for (int i = 0; i < Math.min(path.size(), o.path.size()); i++) {
                if (path.get(i).equals(o.path.get(i))) continue;
                return path.get(i) - o.path.get(i);
            }
            return path.size() - o.path.size();
        }
    }
}
